-
-
Notifications
You must be signed in to change notification settings - Fork 310
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix hexbin
corner case - reorganize test files
#3506
base: master
Are you sure you want to change the base?
Conversation
This is the output from the added tests. Not sure if we want to fix the case with all ones (empty plot because the # degenerate case with singleton 0
save("x0.png", hexbin([0, 0], [1, 2]))
save("y0.png", hexbin([1, 2], [0, 0]))
# degenerate case with singleton 1
save("x1.png", hexbin([1, 1], [1, 2]))
save("y1.png", hexbin([1, 2], [1, 1])) |
For #3507, I've sorted the list of tests to be ran in alphabetical order: this is less error prone. Fixing |
@@ -10,33 +10,28 @@ using GeometryBasics: Pyramid | |||
using Makie: volume | |||
|
|||
@testset "Unit tests" begin | |||
@testset "#659 Volume errors if data is not a cube" begin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: this test is moved to an added issues.jl
file to keep runtests.jl
minimal.
I fail to understand why the EDIT: switching from |
hexbin
corner casehexbin
corner case - reorganize test files
Hum, spurious random CI failure, restored the old |
These are examples from matplotlib, adapted from the hexbin docs: import numpy as np
import matplotlib.pyplot as plt
np.random.seed(19680801)
n = 300
x = np.random.rand(n)
y = np.random.rand(n)
fig, ax = plt.subplots()
ax.hexbin(x, y, gridsize=(3, 4 // 2))
fig.savefig('py-3x4.png')
fig, ax = plt.subplots()
ax.hexbin([0, 0], [1, 2], gridsize=(2, 2 // 2))
fig.savefig('py-x0.png')
fig, ax = plt.subplots()
ax.hexbin([1, 2], [0, 0], gridsize=(2, 2 // 2))
fig.savefig('py-y0.png')
fig, ax = plt.subplots()
ax.hexbin([1, 1], [1, 2], gridsize=(2, 2 // 2))
fig.savefig('py-x1.png')
fig, ax = plt.subplots()
ax.hexbin([1, 2], [1, 1], gridsize=(2, 2 // 2))
fig.savefig('py-y1.png') py-3x4 Here, it seems a value of
I don't really understand what you mean: this seems to be consistent with what matplotlib does, no ?
Agreed. I think we should target uniform hex sizes for singleton cases. |
Description
Fix #3357.
Fix #3507.
Simplified a bit the implementation of
hexbin
(mostly cleanup, unused leftovers, ...).Type of change
Delete options that do not apply:
Checklist